<SCRIPT LANGUAGE="JavaScript"> 
    var xx = 100;
    var yy = 100;
    var tx = 0;
    var ty = 0;
    var dx = 0;
    var dy = 0;
    var klik = 0;
    
    var edxx = 100;
    var edyy = 100;
    var edklik = 0;
    var edtx = 0;
    var edty = 0;
    var eddx = 0;
    var eddy = 0;
    
    
    function swap(temp)
    {
       document.getElementById('myform'+temp).style.visibility = 'visible';
       document.getElementById('myform'+temp).style.height = 'auto';
       document.getElementById('display'+temp).style.visibility = 'hidden';
       document.getElementById('display'+temp).style.height = '0px';
    }
    function swap2(temp)
    {
       document.getElementById('display'+temp).innerHTML = document.getElementById('myform'+temp).innerHTML;
    }
    function swap3(temp)
    {
       document.getElementById('myform'+temp).style.display = 'inherit';
       document.getElementById('display'+temp).style.display = 'none';
    }
    function make_slip()
    {  
        xx=100;
        yy=100;
        klik=0;
        
        var temp = document.getElementById('slip');
        temp.style.position = 'absolute';
        temp.style.top = '100px';
        temp.style.left = '100px';
        temp.style.width = 'auto';
        temp.style.height = 'auto';
        temp.style.borderTop = '2px solid #ddd';
        temp.style.borderLeft = '2px solid #ddd';
        temp.style.borderBottom = '3px solid #aaa';
        temp.style.borderRight = '3px solid #aaa';
        temp.style.padding = '3px';        
        temp.style.backgroundColor = 'white'; 
    }
    
    function close_slip()
    {  
        document.getElementById('slip').innerHTML = '';
        document.getElementById('slip').style.border = 'none';
    }
    
    function tekan(event)
    {
        klik = 1;
        tx=event.clientX;
        ty=event.clientY;
    }
    
    function gerak(event)
    {
        if(klik==1)
        {
            dx=event.clientX-tx;
            dy=event.clientY-ty;
            
            xx = xx + dx;
            yy = yy + dy;
            
            document.getElementById('slip').style.top = yy+'px';
            document.getElementById('slip').style.left = xx+'px';      
            
            tx=event.clientX;
            ty=event.clientY;
        }
    }    
    
    function lepas()
    {
        klik=0;
    }
    
    function editor(temp)
    {
        if(temp.value=='Show Editor')
        { show_editor(); temp.value='Close Editor'; }
        else
        { close_editor(); temp.value='Show Editor'; }
    }
    
    function show_editor()
    {
        edxx=100;
        edyy=100;
        edklik=0;
        
        var temp = document.getElementById('editor');
        temp.style.display = 'inherit';
        temp.style.position = 'absolute';
        temp.style.border = 'solid';
        temp.style.top = '100px';
        temp.style.left = '100px';
        temp.style.width = 'auto';
        temp.style.height = 'auto';
        temp.style.borderTop = '2px solid #ddd';
        temp.style.borderLeft = '2px solid #ddd';
        temp.style.borderBottom = '3px solid #aaa';
        temp.style.borderRight = '3px solid #aaa';
        temp.style.padding = '3px';        
        temp.style.backgroundColor = 'white';    
    }
    
    function close_editor()
    {  
        var temp = document.getElementById('editor');
        temp.style.display = 'none';
        if(document.getElementById('editor_button').value=='Close Editor')
        { document.getElementById('editor_button').value='Show Editor'; }
    }    

    function edtekan(event)
    {
        edklik = 1;
        edtx=event.clientX;
        edty=event.clientY;
    }
    
    function edgerak(event)
    {
        if(edklik==1)
        {
            eddx=event.clientX-edtx;
            eddy=event.clientY-edty;
            
            edxx = edxx + eddx;
            edyy = edyy + eddy;
            
            document.getElementById('editor').style.top = edyy+'px';
            document.getElementById('editor').style.left = edxx+'px';      
            
            edtx=event.clientX;
            edty=event.clientY;
        }
    }    
    
    function edlepas()
    {
        edklik=0;
    }
    
    function view_job(id)
    {
        window.open('../jobs/view/'+id,"_blank","toolbar=no, location=yes, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, top=100, left=100, width=930, height=600");
    }
    
    function view_employer(id)
    {
        window.open('../employers/view/'+id,"_blank","toolbar=no, location=yes, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, top=100, left=100, width=910, height=600");
    }    
    initRTE("../app/webroot/js/images/", "../app/webroot/js/", "../app/webroot/js/");
</SCRIPT>

<?php

    echo "<h2> Control Panel </h2>";
    echo "<hr color='#2A7EF7'>";
    
    echo "<div id='menu_admin'>";
    echo $ajax->link( 'Academic', 
            array('controller' => 'academics', 'action' => 'index_admin'),
            array('update' => 'masterisi')
            );
    echo " | ";
    echo $ajax->link( 'Category', 
            array('controller' => 'fields', 'action' => 'index_admin'),
            array('update' => 'masterisi')
            );
    echo " | ";
    echo $ajax->link( 'City', 
            array('controller' => 'cities', 'action' => 'index_admin'),
            array('update' => 'masterisi')
            );
    echo " | ";
    echo $ajax->link( 'Religion', 
            array('controller' => 'religions', 'action' => 'index_admin'),
            array('update' => 'masterisi')
            );
    echo " | ";
   /*  echo $ajax->link( 'Template', 
            array('controller' => 'templates', 'action' => 'index_admin'),
            array('update' => 'masterisi')
            );
    echo " | ";   */  
    echo $ajax->link( 'Articles', 
            array('controller' => 'articles', 'action' => 'index_admin'),
            array('update' => 'masterisi')
            );
    echo " | ";
    // echo "<input type='button' id='editor_button' value='Show Editor' onclick='editor(this);'>";
  
    
    echo "<br>";
    echo $ajax->link( 'Advs', 
            array('controller' => 'advs', 'action' => 'index_admin'),
            array('update' => 'masterisi')
            );
    echo " | ";   
    echo $ajax->link( 'Jobseekers', 
            array('controller' => 'jobseekers', 'action' => 'index_admin'),
            array('update' => 'masterisi')
            );
    echo " | ";    
    echo $ajax->link( 'Employers', 
            array('controller' => 'employers', 'action' => 'index_admin'),
            array('update' => 'masterisi')
            );
    echo " | ";
    echo $ajax->link( 'Jobs', 
            array('controller' => 'jobs', 'action' => 'index_admin'),
            array('update' => 'masterisi')
            );
    echo " | ";
    echo $ajax->link( 'Testimonial', 
            array('controller' => 'testimonials', 'action' => 'index_admin'),
            array('update' => 'masterisi')
            );
    echo " | ";    
    echo $ajax->link( 'Web Statistic', 
            array('controller' => 'jobs', 'action' => 'web_statistic'),
            array('update' => 'masterisi')
            );
	echo " | ";    
    echo $ajax->link( 'Skills', 
            array('controller' => 'skills', 'action' => 'index_admin'),
            array('update' => 'masterisi')
            );
    echo "</div>";
    
    
    
    
?>


<div id='masterisi' ></div>


<div id='editor' style='display:none'> 
    <?php
    $baseurl = current(split("index", $_SERVER['PHP_SELF']));
    echo "<p class='banner' align='right' onmousedown='edtekan(event);' onmousemove='edgerak(event);' onmouseup='edlepas();' onmouseout='edlepas();'> <a href='Javascript:close_editor();'><img src='".$baseurl."/img/no4.gif' alt='[ X ]'></a></p>";
    ?>
    <SCRIPT language="JavaScript" type="text/javascript">
        writeRichText('rte', '', 400, 200, true, false);
    </SCRIPT>
</div>



